﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DataEntites;
using NoSQLDataProvider;

namespace MVCTest.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        private readonly NoSQLBaseRepository<Users> _collection;

        public HomeController()
        {
            _collection = new NoSQLBaseRepository<Users>();
        }
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";
            var userList = _collection.GetAll(u => u.EMail != "");

            ViewData["Users"] = userList;
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
